Service file to fix symlink for wpa_supplicant.conf #337
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Included script will make sure that if wpa_supplicant.conf is no
longer a symlink but it and /boot/octopi-wpa-supplicant.txt exist,
the selected wifi country will be extracted and written to
/boot/octopi-wpa-supplicant.txt and then the symlink will be
recreated. If wpa_supplicant.conf is completely gone, only the
symlink will be recreated. Nothing will be done if
/boot/octopi-wpa-supplicant.txt does not exist.
The service file ensures that this check is done on every boot,
after the local file system becomes available but before the
networking gets initialized.
This should solve #336
Note that this requires systemd (Debian Jessie) - since current
Raspbian starts SysV init scripts only after networking has
started to initialized, it was impossible for me to create a
SysV init script that fixes the symlink prior to network
initialization.